﻿@inherits Volo.Abp.AspNetCore.Components.AbpComponentBase
<!--<Dropdown Style="display: inherit; width: inherit;"
          OverlayClassName="container">
    <Overlay>
        <Menu Class="menu" OnMenuItemClicked="OnItemSelected">
            <MenuItem>
                <a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">
                    1st menu item
                </a>
            </MenuItem>-->
@*@foreach (var avatarItem in MenuItems)
    {
        if (avatarItem.IsDivider)
        {
            <MenuDivider />
        }
        else
        {
            <MenuItem Key="@avatarItem.Key">
                <Icon Type="@avatarItem.IconType" Theme="@avatarItem.IconTheme" />
                @avatarItem.Option
            </MenuItem>
        }
    }*@
<!--</Menu>
    </Overlay>
    <Unbound>
        @if (CurrentUser.IsAuthenticated && AccountInfoModal != null)
        {
        <span @ref="@context.Current" class="action account">
            <Avatar Size="small" Class="avatar" Src="@AccountInfoModal.Logo" Alt="avatar" />
            <span class="name anticon">@AccountInfoModal.UserName</span>
        </span>
        }
        else
        {
        <span>登录</span>
        }
    </Unbound>
</Dropdown>-->
@if (CurrentUser.IsAuthenticated && AccountInfoModal != null)
{
    <Dropdown>
        <Overlay>
            <Menu>
                @foreach (var avatarItem in MenuItems)
                {
                    if (avatarItem.IsDivider)
                    {
                        <MenuDivider />
                    }
                    else
                    {
                        <MenuItem Key="@avatarItem.Key" RouterLink="@avatarItem.Url">
                            <Icon Type="@avatarItem.IconType" Theme="@avatarItem.IconTheme" />
                            @avatarItem.Option
                        </MenuItem>
                    }
                }
            </Menu>
        </Overlay>
        <Unbound>
            <a class="ant-dropdown-link" @ref="@context.Current" @onclick:preventDefault>
                <Avatar Size="small" Class="avatar" Src="@AccountInfoModal.Logo" Alt="avatar" />
                <span class="name anticon">@AccountInfoModal.UserName</span>
            </a>
        </Unbound>
    </Dropdown>
}
else
{
<a class="btn btn-primary" href="/authentication/login">
    <i class="fa fa-sign-in-alt"></i> @L["Login"]
</a>
}


@code {

}